def get_season_by_month(month):
    """
        根据月份获取季节
    :param month:
    :return:
    """
    if month < 1 or month > 12:
        return '输入有误'
    if 1 <= month <= 3:
        return '春天'
    if 4 <= month <= 6:
        return '夏天'
    if 7 <= month <= 9:
        return '秋天'
    return '冬天'


print(get_season_by_month(2))
